package com.itheima.d4_synchronized_code;



/**
 * 目标：模拟线程安全问题。
 */
public class ThreadTest {
    public static void main(String[] args) {

        Ticket ticket = new Ticket();
        Thread thread1 = new Thread(ticket,"窗口1 ");
        Thread thread2 = new Thread(ticket,"窗口2 ");
        Thread thread3 = new Thread(ticket,"窗口3 ");
        Thread thread4 = new Thread(ticket,"窗口4 ");

        thread1.start();
        thread2.start();
        thread3.start();
        thread4.start();
    }
}

